package a.f.l.a;

public final class cb
{
  private static final double a = 1.0E-006D;
  private static final double c = 1.0D;
  private final double e;
  private final double f;
  private final double g;
  public static boolean h;
  
  public cb(double paramDouble1, double paramDouble2, double paramDouble3)
  {
    this.e = paramDouble1;
    this.f = paramDouble2;
    this.g = Math.max(1.0D, paramDouble3);
  }
  
  public double a()
  {
    return this.e;
  }
  
  public double b()
  {
    return this.f;
  }
  
  public double c()
  {
    return this.g;
  }
  
  boolean a(eb parameb, boolean paramBoolean)
  {
    boolean bool = sb.e;
    if (!bool) {
      if (parameb.a() != -1.797693134862316E+308D)
      {
        if (bool) {
          break label48;
        }
        if (parameb.b() != 1.7976931348623157E+308D) {
          break label39;
        }
      }
    }
    return true;
    label39:
    label48:
    int i = a(parameb.a(), paramBoolean);
    double d = a(i, paramBoolean);
    if (!bool) {}
    return d + this.g <= parameb.b() + 1.0E-006D;
  }
  
  int a(eb parameb, boolean paramBoolean, int paramInt)
  {
    boolean bool = sb.e;
    int k = sb.d;
    if (!bool) {
      if (parameb.a() != -1.797693134862316E+308D)
      {
        if (bool) {
          break label53;
        }
        if (parameb.b() != 1.7976931348623157E+308D) {
          break label44;
        }
      }
    }
    return 0;
    label44:
    label53:
    int i = a(parameb.a(), paramBoolean);
    double d1 = a(i, paramBoolean);
    double d2 = d1 + this.g;
    int j = 0;
    if (j <= paramInt)
    {
      if (k != 0) {
        break label166;
      }
      if (d2 <= parameb.b() + 1.0E-006D) {
        return j;
      }
    }
    label152:
    label157:
    while (bool)
    {
      double d3 = (d1 + d2) / 2.0D;
      if (!bool) {
        if (d3 < parameb.a() - 1.0E-006D)
        {
          d1 = d3;
          if (bool) {
            break label157;
          }
          if (k == 0) {
            break label152;
          }
        }
      }
      d2 = d3;
      j++;
      if (k == 0) {
        break;
      }
    }
    label166:
    return -1;
  }
  
  boolean a(jb paramjb)
  {
    if (!sb.e) {}
    return a(paramjb.e(), !paramjb.a());
  }
  
  double a(int paramInt, boolean paramBoolean)
  {
    if (!sb.e) {}
    return paramInt * this.g + (paramBoolean ? this.e : this.f);
  }
  
  int a(double paramDouble, boolean paramBoolean)
  {
    double d1 = paramBoolean ? this.e : this.f;
    double d2 = (paramDouble - d1) / this.g - 1.0E-006D;
    double d3 = Math.floor(d2);
    double d4 = a((int)d3, paramBoolean);
    if (!sb.e) {
      if (d4 >= paramDouble) {
        return (int)(d3 - 1.0D);
      }
    }
    return (int)d3;
  }
  
  int b(double paramDouble, boolean paramBoolean)
  {
    double d1 = paramBoolean ? this.e : this.f;
    double d2 = (paramDouble - d1) / this.g + 1.0E-006D;
    double d3 = Math.ceil(d2);
    double d4 = a((int)d3, paramBoolean);
    if (!sb.e) {
      if (d4 <= paramDouble) {
        return (int)(d3 + 1.0D);
      }
    }
    return (int)d3;
  }
  
  jb b(jb paramjb)
  {
    if (!sb.e) {}
    eb localeb = b(paramjb.e(), !paramjb.a());
    if (localeb != null) {
      return new jb(localeb, paramjb.f(), paramjb.a());
    }
    return null;
  }
  
  eb b(eb parameb, boolean paramBoolean)
  {
    int i = a(parameb.a(), paramBoolean) + 1;
    int j = b(parameb.b(), paramBoolean) - 1;
    if (j >= i) {
      return new eb(a(i, paramBoolean), a(j, paramBoolean));
    }
    return null;
  }
  
  double a(double paramDouble, eb parameb, boolean paramBoolean)
  {
    return a(paramDouble, parameb, paramBoolean, 0);
  }
  
  double a(double paramDouble, eb parameb, boolean paramBoolean, int paramInt)
  {
    boolean bool = sb.e;
    int k = sb.d;
    if (a(parameb, paramBoolean, paramInt) >= 0)
    {
      double d1 = parameb.c(paramDouble);
      int i = a(d1, paramBoolean);
      double d2 = a(i, paramBoolean);
      double d3 = d2 + this.g;
      int j = 0;
      if (j < paramInt) {}
      label115:
      while (bool)
      {
        double d4 = (d2 + d3) / 2.0D;
        if (k != 0) {
          break label138;
        }
        if (d4 >= d1)
        {
          d3 = d4;
          if (bool) {
            break label115;
          }
          if (k == 0) {}
        }
        else
        {
          d2 = d4;
        }
        j++;
        if (k == 0) {
          break;
        }
      }
      label138:
      j = Math.abs(d2 - paramDouble) <= Math.abs(d3 - paramDouble) ? 1 : 0;
      if (!bool)
      {
        if (j != 0)
        {
          if (bool) {
            break label196;
          }
          if (parameb.b(d2) < 1.0E-006D) {}
        }
        else
        {
          if (bool) {
            break label199;
          }
        }
      }
      else {
        if (parameb.b(d3) <= 1.0E-006D) {
          break label197;
        }
      }
      label196:
      return d2;
      label197:
      label199:
      return d3;
    }
    return (1.0D / 0.0D);
  }
  
  double a(double paramDouble, jb paramjb)
  {
    if (!sb.e) {}
    return a(paramDouble, paramjb.e(), !paramjb.a());
  }
  
  public String toString()
  {
    return "Grid[(" + this.e + ";" + this.f + "); " + this.g + "]";
  }
  
  double c(double paramDouble, jb paramjb)
  {
    double d = a(paramDouble, paramjb);
    if (!sb.e) {}
    return d == (1.0D / 0.0D) ? (1.0D / 0.0D) : Math.abs(paramDouble - d);
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.f.l.a.cb
 * JD-Core Version:    0.7.0.1
 */